#ifndef INVENTORYWINDOW_H
#define INVENTORYWINDOW_H
class inventory_error : public std::logic_error 
{
public:
	inventory_error(const std::string &error) : logic_error(error) { }
};
class InventoryWindow
{
private:
       struct SDL_Surface *winBackground_;
       struct SDL_Surface *window_;
       struct SDL_Rect winRect_;
       struct SDL_Rect winBRect_;
       bool visible_;
       class SDLButton *closeButton_;
       class SDLText *closeText_;
       class SDLText *titleText_;
       class Character *character_;
       void drawItems();
       int getClickedItem(int x, int y);
       void ItemAction(int num, SDLMap *map);
       bool rightHandClicked;
       bool leftHandClicked;
       void drawHand(std::string image, int x, int y);

       struct SDL_Surface *item_;       
       struct SDL_Rect itemRect_;
       struct SDL_Surface *highlight_;
       struct SDL_Rect lightRect_;
public:
       InventoryWindow(class Character *character) throw(inventory_error);
       ~InventoryWindow();
       void show();
       void hide();
       void render(struct SDL_Surface *screen);
       bool is_clicked(int x, int y, bool &visible, class SDLMap *map);
};
#endif